﻿using System;

using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
using Sautom.ClientComunication;
using Sautom.Modules.Authorization.Views;

namespace Sautom.Modules.Authorization
{
    public class ModuleInit : IModule
    {
        private readonly IUnityContainer _container;
        private readonly IRegionManager _regionManager;

        public ModuleInit(IUnityContainer container, IRegionManager regionManager)
        {
            _container = container;
            _regionManager = regionManager;
        }

        #region IModule Members

        public void Initialize()
        {
            _container.RegisterType<Object, Login>(PathProvider.Login);
            _container.RegisterType<Object, ChangePassword>(PathProvider.ChangePassword);

            _regionManager.RequestNavigate(RegionProvider.MainRegion, PathProvider.Login);
        }

        #endregion
    }
}
